package com.yidu.BusinessParament.mapper;

import com.yidu.BusinessParament.entity.Plate;
import org.apache.ibatis.annotations.*;

import java.util.List;
import java.util.Map;

/**
 *股票板块表
 * @author :yimeng
 * @date :2022/12/13  14:43
 * @description:some description
 */
@Mapper
public interface PlateMapper {
    //普通查询所有
    @Select("select * from plate")
    List<Plate> selectPlate();

    //查询总数
    @Select("select count(*) from plate")
    int selectCountPlate(Map map);

    //添加数据
    @Insert("INSERT INTO plate VALUES(#{plateId},#{plateName},#{plateFatherId},#{Remark})")
    int insertPlate(Plate plate);

    //删除数据
    @Delete("delete from plate where plateId = #{plateId}")
    int deletePlate(String plateId);

    //修改数据
    @Update("update plate set plateName=#{plateName},plateFatherId=#{plateFatherId}," +
            "Remark=#{Remark} where plateId=#{plateId}")
    int updatePlate(Plate plate);

}
